class Solution(object):
    def checkZeroOnes(self, s):
        n = len(s)
        left = 0
        right = 0
        d = {'0':0, '1':0}
        while right < n:
            if s[right] == s[left]:
                d[s[right]] = max(d[s[right]], right - left + 1)
                right += 1
            else:
                left = right
        return d['1'] > d['0']
